package com.tuton.javanet.chapter01;

import java.io.*;

public class EchoPlayer {
	
	private String echo(String msg){
		return "echo: " + msg;
	}
	
	private void talk() throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String msg = null;
		while((msg = br.readLine())!= null) {
			System.out.println(echo(msg));
			if("bye".equalsIgnoreCase(msg)) {
				break;
			}
		}
	
	}
	
	public static void main(String[] args) throws IOException{
		EchoPlayer app = new EchoPlayer();
		app.talk();
	}
	
}

//这里是自己和自己玩，将这个程序所实现的功能编程client端和server端的交互
